<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 求并集
         var arr1 = [1,2,3,4]
         var arr2 = [2,4,5,6]
         var arr3

        //  合并数组
        arr2.push(...arr1)
        // 集合去重
        arr3=new Set(arr2)
        // 转数组
       let arr4=Array.from(arr3)
        console.log(arr4)
    </script>
</body>
</html>